package com.example.myapplication.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

import android.util.AttributeSet;
import android.view.View;

/**
 * 移动
 * 作者：李祥
 * 邮箱：499194689@qq.com
 */

public class TestView01 extends View {
    private Paint paint = new Paint();

    public TestView01(Context context) {
        super(context);
    }

    public TestView01(Context context,  AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        // 在坐标原点绘制一个黑色圆形
        paint.setColor(Color.BLACK);
        canvas.translate(50, 50);
        canvas.drawCircle(0, 0, 50, paint);

        // 在坐标原点绘制一个蓝色圆形
        paint.setColor(Color.BLUE);
        canvas.translate(50, 50);
        canvas.drawCircle(0, 0, 50, paint);

    }
}
